package cn.gogpay.dcb.api.service;

import cn.gogpay.dcb.api.feign.PublicTrafficClient;
import cn.gogpay.dcb.api.web.form.StationInfoForm;
import cn.gogpay.dcb.common.dto.ResultDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * description
 *
 * @author huangting@gogpay.cn
 * @date 2020/1/19 9:44
 */
@Service
public class PublicTrafficService {
    private static final Logger logger = LoggerFactory.getLogger(OutService.class);

    @Autowired
    private PublicTrafficClient publicTrafficClient;

    /**
     * 根据经纬度获取车站信息
     *
     * @param form
     * @return
     */
    public ResultDTO getStationInfo(StationInfoForm form) {
        ResultDTO stationInfo = publicTrafficClient.getStationInfo(new BigDecimal(form.getLng()), new BigDecimal(form.getLat()));
        return stationInfo;
    }
}
